package hn.cch.advanced.thread;

public class ExtendsThread extends Thread {
    //继承Thread类的run方法
    @Override
    public void run() {
        while (true) {
            try {
                Thread.sleep(1000);
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
            System.out.println("thread=" + Thread.currentThread().getName());
        }
    }

    public static void main(String[] args) {
        ExtendsThread extendsThread = new ExtendsThread();
        extendsThread.start();
    }
}
